package com.lagou.com.lagou.homework.Modules2.item3;

public class CallSetMeal extends ShareAbstract {
    private int callTimes;
    private int messages;
    private int mouDz;

    public CallSetMeal() {
    }

    @Override
    public void show4() {
        System.out.println("CallSetMeal重新ShareAbstract的show()4");
        System.out.println("继承抽象类，显示套餐");
    }

    public CallSetMeal(int callTimes, int messages, int mouDz) {
        setCallTimes(callTimes);
        setMessages(messages);
        setMouDz(mouDz);
        /*this.callTimes = callTimes;
        this.messages = messages;
        this.mouDz = mouDz;*/
    }

    public int getCallTimes() {
        return callTimes;
    }

    public void setCallTimes(int callTimes) {
        if (callTimes >= 0) {
            this.callTimes = callTimes;
        }else{
            System.out.println("输入不合理");
        }

    }

    public int getMessages() {
        return messages;
    }

    public void setMessages(int messages) {
        if (messages >= 0){
            this.messages = messages;
        }else{
            System.out.println("输入不合理");
        }
    }

    public int getMouDz() {
        return mouDz;
    }

    public void setMouDz(int mouDz) {
        if (mouDz >= 0){
            this.mouDz = mouDz;
        }else{
            System.out.println("输入不合理");
        }

    }
    public void show1() {
        System.out.println("剩余时长:" + getCallTimes() + ",短信:" + getMessages() + ",每月资费：" + getMouDz());
        show4();
    }
}
